package cn.kjcoder.productServer.service.impl;

import cn.kjcoder.productServer.repository.ProductRepository;
import cn.kjcoder.productServer.domain.Product;
import cn.kjcoder.productServer.service.IProductService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author hkj
 * @email 1349091387@qq.com
 * @date 2021/12/21
 * 源码允许修改，并且本人十分乐意有 大佬 来对代码进行 随 意 调 教
 **/
@Service
@Slf4j
public class ProductServiceImpl implements IProductService {

    @Autowired
    private ProductRepository productRepository;

    @Override
    public Product findById(Long pid) {
        log.info("商品服务层调用");
        return productRepository.findById(pid).get();
    }
}
